package com.imut.lagain.service.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.imut.lagain.entity.MoodThief;
import com.imut.lagain.mapper.MoodThiefMapper;
import com.imut.lagain.repository.MoodThiefRepository;
import com.imut.lagain.service.IMoodThiefService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.List;

/**
 * 心情小偷服务实现类
 */
@Service
public class MoodThiefServiceImpl extends ServiceImpl<MoodThiefMapper, MoodThief> implements IMoodThiefService {
    private static final Logger log = LoggerFactory.getLogger(MoodThiefServiceImpl.class);

    
    @Autowired
    private MoodThiefRepository moodThiefRepository;
    
    /**
     * 根据小偷类型查询心情小偷
     * @param thiefType 小偷类型
     * @return 心情小偷信息
     */
    @Override
    public MoodThief findByThiefType(String thiefType) {
        return moodThiefRepository.findByThiefType(thiefType);
    }
    
    /**
     * 查询未删除的心情小偷列表
     * @param page 分页参数
     * @return 心情小偷分页列表
     */
    @Override
    public IPage<MoodThief> findActiveMoodThieves(Page<MoodThief> page) {
        return moodThiefRepository.findActiveMoodThieves(page);
    }
    
    /**
     * 根据显示名称模糊查询心情小偷
     * @param displayName 显示名称关键字
     * @param page 分页参数
     * @return 心情小偷分页列表
     */
    @Override
    public IPage<MoodThief> findByDisplayNameLike(String displayName, Page<MoodThief> page) {
        return moodThiefRepository.findByDisplayNameLike(displayName, page);
    }
    
    /**
     * 查询所有未删除的心情小偷
     * @return 心情小偷列表
     */
    @Override
    public List<MoodThief> findAllActive() {
        return moodThiefRepository.findAllActive();
    }
}
